package com.mkh.st.common.security.exception;

import com.mkh.st.common.core.constant.enums.ResultCodeEnum;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;
import org.springframework.security.oauth2.common.exceptions.OAuth2Exception;

@Data
@Slf4j
public class LoginAuthException extends OAuth2Exception {
	private static final long serialVersionUID = 1L;
	private int code;
	private String message;

	public LoginAuthException(String message) {
		super(message);
		this.code = 400;
		this.message = message;
	}
	public LoginAuthException(int code, String message) {
		super(message);
		this.code = code;
		this.message = message;
	}
	public LoginAuthException(ResultCodeEnum resultCodeEnum) {
		super(resultCodeEnum.getMsg());
		this.code = resultCodeEnum.getCode();
		this.message = resultCodeEnum.getMsg();
	}
}
